using System;
using System.Collections.Generic;
using System.Text;

namespace Sio.Mdm.Server
{
    /// <summary>
    /// Declares services or handlers that require <see cref="IServer"/> instance.
    /// </summary>
    /// <remarks>
    /// Currently security handlers, invocation handlers and services support this interface
    /// </remarks>
    /// <seealso cref="IService"/>
    /// <seealso cref="ISecurityHandler"/>
    /// <seealso cref="IInvokeInterceptor"/>
    public interface IRequireServerInstance
    {
        /// <summary>
        /// Setter for <see cref="Server"/> instance. 
        /// </summary>
        /// <remarks>
        /// Instance passed to setter is valid for lifetime
        /// of service instance so <b>don't</b> store it in global
        /// variables. Use it only for lifetime of the instance.
        /// You should also make sure that any reference to instance 
        /// passed is reset to null but <b>never</b> disposed.
        /// </remarks>
        IServer Server { set;}
    }
}
